/**
 * 
 */
package edu.umd.clip.lm.model.training.metrics;

import org.w3c.dom.Element;

import edu.umd.clip.lm.model.training.ContextVariable;
import edu.umd.clip.lm.model.training.ContextVariableStats;

/**
 * @author Denis Filimonov <den@cs.umd.edu>
 *
 */
public class TimeAndTypeOrderedMetrics extends ContextVariableMetrics {

	public TimeAndTypeOrderedMetrics(Element elem) {
		super(elem);
	}

	public TimeAndTypeOrderedMetrics() {
		super("order by time and type (hidden then overt)");
	}

	/* (non-Javadoc)
	 * @see edu.umd.clip.lm.model.training.metrics.ContextVariableMetrics#computeScore(edu.umd.clip.lm.model.training.ContextVariable, edu.umd.clip.lm.model.training.ContextVariableStats)
	 */
	@Override
	public double computeScore(ContextVariable ctxVar, ContextVariableStats stat) {
		int offset = ctxVar.getOffset();
		return -offset * 2 + (ctxVar.isHidden() ? 0 : 1);
	}

	/* (non-Javadoc)
	 * @see edu.umd.clip.lm.model.training.metrics.ContextVarStatUser#needContextVarCounts()
	 */
	@Override
	public boolean needContextVarCounts() {
		return false;
	}

	/* (non-Javadoc)
	 * @see edu.umd.clip.lm.model.training.metrics.ContextVarStatUser#needVarToWordCounts()
	 */
	@Override
	public boolean needVarToWordCounts() {
		return false;
	}

	/* (non-Javadoc)
	 * @see edu.umd.clip.lm.model.training.metrics.ContextVarStatUser#needWordCounts()
	 */
	@Override
	public boolean needWordCounts() {
		return false;
	}

	/* (non-Javadoc)
	 * @see edu.umd.clip.lm.model.training.metrics.ContextVarStatUser#needWordToVarCounts()
	 */
	@Override
	public boolean needWordToVarCounts() {
		return false;
	}

}
